package edu.xlh.travel.websocket.service.impl;

import edu.xlh.travel.websocket.dao.Emp_groupDao;
import edu.xlh.travel.websocket.domin.Emp_friend;
import edu.xlh.travel.websocket.domin.Emp_group;
import edu.xlh.travel.websocket.service.Emp_groupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class Emp_groupServiceImpl implements Emp_groupService {
    @Autowired
    private Emp_groupDao emp_groupDao;
    @Override
    public List<Emp_group> findEmp_groupByUserId(String userId) {
        Emp_group emp_group = new Emp_group();
        emp_group.setEmpId(userId);
        Example<Emp_group> example = Example.of(emp_group);
        return emp_groupDao.findAll(example);
    }

    @Override
    public List<Emp_group> findByGroupId(String groupId) {
        Emp_group emp_group = new Emp_group();
        emp_group.setGroupId(groupId);
        Example<Emp_group> example = Example.of(emp_group);
        return emp_groupDao.findAll(example);
    }
}
